(function () {
    function WarnPrint(data) {

        for(var b=0;b<data.length;b++){

        if(data[b].boxsCount.length>1){
              var  cou = data[b].boxsCount.length;
              console.log("=============cou="+cou);
              var coupage = 1;
              if((cou % 10) == 0) {
                  coupage = parseInt(cou / 10);
              }else{
                  coupage = parseInt(cou / 10) + 1;
              }
               console.log("=============coupage="+coupage);

             for(var q =0;q<coupage;q++){
                    LODOP.PRINT_INIT("安图生物打印模板");

                   if(q==(coupage-1)){
                    var t = cou-(coupage-1)*10;
                    for(var r=0;r<t;r++){
                            
                           var e = (coupage-1)*10+r;
                           console.log("=============e="+e);
                           LODOP.ADD_PRINT_IMAGE(10,20,70,50,"<img border='0' src='http://192.168.1.9:8086/photo/log.jpg' width='380' heigh='80'/>");
                           LODOP.SET_PRINT_STYLEA(0,"Stretch",1)
                           LODOP.ADD_PRINT_TEXT(50,120,71,20,"发货单号");
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           console.log("=============data[e].headDetail.fbillno="+data[b].headDetail.fbillno);
                           LODOP.ADD_PRINT_TEXT(50,190,115,20,data[b].headDetail.fbillno);
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.ADD_PRINT_TEXT(6,100,130,35,data[b].boxsCount[e]+"号箱");
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
                           LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);

                           LODOP.ADD_PRINT_TEXT(6,220,160,35,data[b].headDetail.FCity);
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
                           LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.ADD_PRINT_TEXT(69,15,45,40,"收货\r\n单位");
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.ADD_PRINT_TEXT(69,64,298,40,data[b].headDetail.FReceive);
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.ADD_PRINT_TEXT(108,15,45,40,"收货\r\n地址");
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.ADD_PRINT_TEXT(108,62,300,40,data[b].headDetail.faddress);
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.ADD_PRINT_TEXT(147,15,59,20,"联系人");
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.ADD_PRINT_TEXT(147,79,163,20,data[b].headDetail.FContacts);
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.ADD_PRINT_TEXT(167,15,46,19,"电话");
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.ADD_PRINT_TEXT(167,75,280,20,data[b].headDetail.FMobile+"   "+data[b].headDetail.FTel);
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.ADD_PRINT_TEXT(187,200,160,20,"冷藏物品请尽快派送");
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.ADD_PRINT_TEXT(187,15,280,20,"日期");
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.ADD_PRINT_TEXT(187,79,289,20,data[b].headDetail.FDate.split("T")[0]);
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.ADD_PRINT_TEXT(206,15,300,45,"郑州安图生物工程股份有限公司\r\n郑州经济技术开发区经开第十五大街199号\r\nTEL:0371-67985875  67985876");
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.ADD_PRINT_TEXT(256,15,360,30,"产品名称、包装规格、生产日期、产品批号、失效日\r\n期、储存条件、注册文号等详情见试剂盒包装");
                           LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                           LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                           LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                           LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
                           LODOP.ADD_PRINT_IMAGE(290,40,310,80,"<img border='0' src='http://192.168.1.9:8086/photo/notic.jpg' width='380' heigh='80'/>");
                           LODOP.SET_PRINT_STYLEA(0,"Stretch",1)


                           for(var j=0;j<data[b].bodyList.length;j++){
                              var body = data[b].bodyList[j];
                              LODOP.ADD_PRINT_TEXT(372+48*j,15,373,30,body.FEntryName);
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
                             LODOP.ADD_PRINT_TEXT(400+48*j,15,160,15,body.FEntryModel);
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.ADD_PRINT_TEXT(400+48*j,175,105,15,body.FBatchNo);
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.ADD_PRINT_TEXT(400+48*j,279,56,15,(body.FDoneNumber/data[b].boxsCount.length).toFixed(2));
                             LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.ADD_PRINT_TEXT(400+48*j,335,76,15,body.FUnitName);
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                         }
                          LODOP.NewPage();

                    }
                   }else{
                    for(var w=0;w<10;w++){
                                       var e = q*10+w;
                                       console.log("=============e="+e);
                                       LODOP.ADD_PRINT_IMAGE(10,20,70,50,"<img border='0' src='http://192.168.1.9:8086/photo/log.jpg' width='380' heigh='80'/>");
                                       LODOP.SET_PRINT_STYLEA(0,"Stretch",1)
                                       LODOP.ADD_PRINT_TEXT(50,120,71,20,"发货单号");
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       console.log("=============data[e].headDetail.fbillno="+data[b].headDetail.fbillno);
                                       LODOP.ADD_PRINT_TEXT(50,190,115,20,data[b].headDetail.fbillno);
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.ADD_PRINT_TEXT(6,100,130,35,data[b].boxsCount[e]+"号箱");
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
                                       LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);

                                       LODOP.ADD_PRINT_TEXT(6,220,160,35,data[b].headDetail.FCity);
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
                                       LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.ADD_PRINT_TEXT(69,15,45,40,"收货\r\n单位");
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.ADD_PRINT_TEXT(69,64,298,40,data[b].headDetail.FReceive);
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.ADD_PRINT_TEXT(108,15,45,40,"收货\r\n地址");
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.ADD_PRINT_TEXT(108,62,300,40,data[b].headDetail.faddress);
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.ADD_PRINT_TEXT(147,15,59,20,"联系人");
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.ADD_PRINT_TEXT(147,79,163,20,data[b].headDetail.FContacts);
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.ADD_PRINT_TEXT(167,15,46,19,"电话");
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.ADD_PRINT_TEXT(167,75,280,20,data[b].headDetail.FMobile+"   "+data[b].headDetail.FTel);
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.ADD_PRINT_TEXT(187,200,160,20,"冷藏物品请尽快派送");
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.ADD_PRINT_TEXT(187,15,280,20,"日期");
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.ADD_PRINT_TEXT(187,79,289,20,data[b].headDetail.FDate.split("T")[0]);
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.ADD_PRINT_TEXT(206,15,300,45,"郑州安图生物工程股份有限公司\r\n郑州经济技术开发区经开第十五大街199号\r\nTEL:0371-67985875  67985876");
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.ADD_PRINT_TEXT(256,15,360,30,"产品名称、包装规格、生产日期、产品批号、失效日\r\n期、储存条件、注册文号等详情见试剂盒包装");
                                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                                       LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
                                       LODOP.ADD_PRINT_IMAGE(290,40,310,80,"<img border='0' src='http://192.168.1.9:8086/photo/notic.jpg' width='380' heigh='80'/>");
                                       LODOP.SET_PRINT_STYLEA(0,"Stretch",1)


                                       for(var j=0;j<data[b].bodyList.length;j++){
                                          var body = data[b].bodyList[j];
                                          LODOP.ADD_PRINT_TEXT(372+48*j,15,373,30,body.FEntryName);
                                         LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                         LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
                                         LODOP.ADD_PRINT_TEXT(400+48*j,15,160,15,body.FEntryModel);
                                         LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                         LODOP.ADD_PRINT_TEXT(400+48*j,175,105,15,body.FBatchNo);
                                         LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                         LODOP.ADD_PRINT_TEXT(400+48*j,279,56,15,(body.FDoneNumber/data[b].boxsCount.length).toFixed(2));
                                         LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
                                         LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                         LODOP.ADD_PRINT_TEXT(400+48*j,335,76,15,body.FUnitName);
                                         LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                     }
                                      LODOP.NewPage();
                                   }
                   }


//               LODOP.NewPage();
               LODOP.SET_PRINT_MODE("CUSTOM_TASK_NAME","安图生物打印模板"+i);//为每个打印单独设置任务名
                var enddf = LODOP.PRINT();
             }
//            for(var i=0;i<data[b].boxsCount.length;i++){
//                       LODOP.PRINT_INIT("安图生物打印模板");
//                       LODOP.ADD_PRINT_IMAGE(10,20,70,50,"<img border='0' src='http://192.168.1.9:8086/photo/log.jpg' width='380' heigh='80'/>");
//                       LODOP.SET_PRINT_STYLEA(0,"Stretch",1)
//                       LODOP.ADD_PRINT_TEXT(50,120,71,20,"发货单号");
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(50,190,115,20,data[b].headDetail.fbillno);
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(6,100,130,35,data[b].boxsCount[i]+"号箱");
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
//                       LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//
//                       LODOP.ADD_PRINT_TEXT(6,220,160,35,data[b].headDetail.FCity);
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
//                       LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(69,15,45,40,"收货\r\n单位");
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(69,64,298,40,data[b].headDetail.FReceive);
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(108,15,45,40,"收货\r\n地址");
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(108,62,300,40,data[b].headDetail.faddress);
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(147,15,59,20,"联系人");
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(147,79,163,20,data[b].headDetail.FContacts);
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(167,15,46,19,"电话");
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(167,75,280,20,data[b].headDetail.FMobile+"   "+data[b].headDetail.FTel);
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(187,200,160,20,"冷藏物品请尽快派送");
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(187,15,280,20,"日期");
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(187,79,289,20,data[b].headDetail.FDate.split("T")[0]);
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.ADD_PRINT_TEXT(206,15,300,45,"郑州安图生物工程股份有限公司\r\n郑州经济技术开发区经开第十五大街199号\r\nTEL:0371-67985875  67985876");
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.ADD_PRINT_TEXT(256,15,360,30,"产品名称、包装规格、生产日期、产品批号、失效日\r\n期、储存条件、注册文号等详情见试剂盒包装");
//                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                       LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
//                       LODOP.SET_PRINT_STYLEA(0,"Bold",1);
//                       LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
//                       LODOP.ADD_PRINT_IMAGE(290,40,310,80,"<img border='0' src='http://192.168.1.9:8086/photo/notic.jpg' width='380' heigh='80'/>");
//                       LODOP.SET_PRINT_STYLEA(0,"Stretch",1)
//                for(var j=0;j<data[b].bodyList.length;j++){
//                   var body = data[b].bodyList[j];
//                   LODOP.ADD_PRINT_TEXT(372+48*j,15,373,30,body.FEntryName);
//                  LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                  LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
//                  LODOP.ADD_PRINT_TEXT(400+48*j,15,160,15,body.FEntryModel);
//                  LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                  LODOP.ADD_PRINT_TEXT(400+48*j,175,105,15,body.FBatchNo);
//                  LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                  LODOP.ADD_PRINT_TEXT(400+48*j,279,56,15,(body.FDoneNumber/data[b].boxsCount.length).toFixed(2));
//                  LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
//                  LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//                  LODOP.ADD_PRINT_TEXT(400+48*j,335,76,15,body.FUnitName);
//                  LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
//              }
//                LODOP.NewPage();
//                LODOP.SET_PRINT_MODE("CUSTOM_TASK_NAME","安图生物打印模板"+i);//为每个打印单独设置任务名
//                 var enddf = LODOP.PRINT();
//            }
        }else{
             LODOP.PRINT_INIT("安图生物打印模板");
             LODOP.ADD_PRINT_IMAGE(10,20,70,50,"<img border='0' src='http://192.168.1.9:8086/photo/log.jpg' width='380' heigh='80'/>");
                             LODOP.SET_PRINT_STYLEA(0,"Stretch",1)
                             LODOP.ADD_PRINT_TEXT(50,120,71,20,"发货单号");
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(50,190,115,20,data[b].headDetail.fbillno);
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(6,100,130,35,data[b].boxsCount[0]+"号箱");
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
                             LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);

                             LODOP.ADD_PRINT_TEXT(6,220,160,35,data[b].headDetail.FCity);
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",20);
                             LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(69,15,45,40,"收货\r\n单位");
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(69,64,298,40,data[b].headDetail.FReceive);
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(108,15,45,40,"收货\r\n地址");
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(108,62,300,40,data[b].headDetail.faddress);
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(147,15,59,20,"联系人");
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(147,79,163,20,data[b].headDetail.FContacts);
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(167,15,46,19,"电话");
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(167,75,280,20,data[b].headDetail.FMobile+"   "+data[b].headDetail.FTel);
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(187,200,160,20,"冷藏物品请尽快派送");
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(187,15,280,20,"日期");
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(187,79,289,20,data[b].headDetail.FDate.split("T")[0]);
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.ADD_PRINT_TEXT(206,15,300,45,"郑州安图生物工程股份有限公司\r\n郑州经济技术开发区经开第十五大街199号\r\nTEL:0371-67985875  67985876");
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.ADD_PRINT_TEXT(256,15,360,30,"产品名称、包装规格、生产日期、产品批号、失效日\r\n期、储存条件、注册文号等详情见试剂盒包装");
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                             LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
             //                LODOP.ADD_PRINT_TEXT(234,73,278,20,"郑州安图生物工程股份有限公司");
             //                LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
             //                LODOP.SET_PRINT_STYLEA(0,"Bold",1);

                             LODOP.ADD_PRINT_IMAGE(290,40,310,80,"<img border='0' src='http://192.168.1.9:8086/photo/notic.jpg' width='380' heigh='80'/>");
                             LODOP.SET_PRINT_STYLEA(0,"Stretch",1)
                var count = data[b].bodyList.length;
                if(count <3){
                     for(var i=0;i<data[b].bodyList.length;i++){
                           var body = data[b].bodyList[i];
                           LODOP.ADD_PRINT_TEXT(372+48*i,15,373,30,body.FEntryName);
                          LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                          LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
                          LODOP.ADD_PRINT_TEXT(400+48*i,15,160,15,body.FEntryModel);
                          LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                          LODOP.ADD_PRINT_TEXT(400+48*i,175,105,15,body.FBatchNo);
                          LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                          LODOP.ADD_PRINT_TEXT(400+48*i,279,56,15,body.FDoneNumber);
                          LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
                          LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                          LODOP.ADD_PRINT_TEXT(400+48*i,335,76,15,body.FUnitName);
                          LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                     }
                }else{
                     for(var a=0;a<3;a++){
                        var body = data[b].bodyList[a];
                        LODOP.ADD_PRINT_TEXT(372+48*a,15,373,30,body.FEntryName);
                        LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                        LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
                       LODOP.ADD_PRINT_TEXT(400+48*a,15,160,15,body.FEntryModel);
                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                       LODOP.ADD_PRINT_TEXT(400+48*a,175,105,15,body.FBatchNo);
                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                       LODOP.ADD_PRINT_TEXT(400+48*a,279,56,15,body.FDoneNumber);
                       LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                       LODOP.ADD_PRINT_TEXT(400+48*a,335,76,15,body.FUnitName);
                       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                      }
                      var pages = count-3;
                      var totalPages = 1;
                      if((pages % 10) == 0) {
                          totalPages = parseInt(pages / 10);
                      }else{
                          totalPages = parseInt(pages / 10) + 1;
                      }
                      for(var j=0;j<totalPages;j++){
                LODOP.NewPage();
                if(j==totalPages-1){
                 LODOP.ADD_PRINT_TEXT(8,200,100,30,data[b].boxsCount[0]+"号箱");
                 LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                 LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
                 LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                 LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                    var end = count - (totalPages-1)*10-3;
                    for(var k=0;k<end;k++){
                        var body1 = data[b].bodyList[3+k+j*10];
                        LODOP.ADD_PRINT_TEXT(40+48*k,15,373,30,body1.FEntryName);
                        LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                        LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
                        LODOP.ADD_PRINT_TEXT(67+48*k,15,160,15,body1.FEntryModel);
                        LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                        LODOP.ADD_PRINT_TEXT(67+48*k,175,105,15,body1.FBatchNo);
                        LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                        LODOP.ADD_PRINT_TEXT(67+48*k,279,56,15,body1.FDoneNumber);
                        LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
                        LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                        LODOP.ADD_PRINT_TEXT(67+48*k,335,76,15,body1.FUnitName);
                        LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                    }
                 }else{
                        LODOP.ADD_PRINT_TEXT(8,200,100,30,data[b].boxsCount[0]+"号箱");
                             LODOP.SET_PRINT_STYLEA(0,"FontName","黑体");
                             LODOP.SET_PRINT_STYLEA(0,"FontSize",15);
                             LODOP.SET_PRINT_STYLEA(0,"Alignment",2);
                             LODOP.SET_PRINT_STYLEA(0,"Bold",1);
                            for(var k=0;k<10;k++){
                                var body1 = data[b].bodyList[3+k+j*10];
                                LODOP.ADD_PRINT_TEXT(40+48*k,15,373,30,body1.FEntryName);
                                LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                LODOP.SET_PRINT_STYLEA(0,"LineSpacing",-3);
                                LODOP.ADD_PRINT_TEXT(67+48*k,15,160,15,body1.FEntryModel);
                                LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                LODOP.ADD_PRINT_TEXT(67+48*k,175,105,15,body1.FBatchNo);
                                LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                LODOP.ADD_PRINT_TEXT(67+48*k,279,56,15,body1.FDoneNumber);
                                LODOP.SET_PRINT_STYLEA(0,"Alignment",3);
                                LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                                LODOP.ADD_PRINT_TEXT(67+48*k,335,76,15,body1.FUnitName);
                                LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
                            }
                 }
               }
           }
           LODOP.NewPage();
           var enddf = LODOP.PRINT();
        }

        }

//        var enddf = LODOP.PRINT();
//LODOP.PREVIEW("_blank",350,560);
//          LODOP.SET_PRINT_MODE("CATCH_PRINT_STATUS",true);
//          LODOP.SET_PRINT_STYLEA(0,"HtmWaitMilSecs",8000);

//          var enddf = LODOP.PREVIEW("_blank",350,560);
          window.MyBrowserAPI.get(enddf);
    }
    window.WarnPrint = WarnPrint;
})();
